<template>
	<view style="padding-bottom: 180upx;" v-if="VehicleInfo" >
		<view>
			<view class="zcModel-title zcJustifyC_between">车辆信息</view>
		</view>
		<block v-for="(item1,idx1) in VehicleInfo.vehicleInfo" :key="idx1" >
			<zc-card :zcIndex="idx1" :cardItem="item1" @zcChengeValue="zcChangeValue1" @zcInputClick="zcInputClick"></zc-card>
		</block>
		<view class="moreBox zcDisabled">
			<view :class="{'carMore':isCarInfoMore}">
				<block v-for="(itemMore,idxMore) in VehicleInfo.vehicleInfoMore" :key="idxMore" >
					<zc-card :zcIndex="idxMore" :cardItem="itemMore" @zcChengeValue="zcChangeMoreValue" @zcInputClick="zcInputClick"></zc-card>
				</block>
			</view>
			<view style="background-color: #FFFFFF;">
				<view @tap="doCarInfoMore" class="uni-flex zcJustifyC_center zcAlignI_center">
					{{CarInfoMoreText}}
					<view class="iconfont icon-Order-Details-SeeMore" :style="{'transform':isCarInfoMore?'rotate(180deg)':''}"></view>
				</view>
			</view>
		</view>
		
		<view>
			<view class="zcModel-title zcJustifyC_between">客户信息</view>
		</view>
		<block v-for="(item2,idx2) in VehicleInfo.customerInfo" :key="idx2" >
			<zc-card :zcIndex="idx2" :cardItem="item2" @zcChengeValue="zcChangeValue2"></zc-card>
		</block>
		<view class="moreBox">
			<view :class="{'customerMore':isCustomerInfoMore}">
				<block v-for="(itemMore2,idxMore2) in VehicleInfo.customerInfoMore" :key="idxMore2" >
					<zc-card :zcIndex="idxMore2" :cardItem="itemMore2" @zcChengeValue="zcChangeMore2Value" @zcInputClick="zcInputClick"></zc-card>
				</block>
			</view>
			<view style="background-color: #FFFFFF;">
				<view @tap="doCustomerInfoMore" class="uni-flex zcJustifyC_center zcAlignI_center">
					{{CustomerInfoMoreText}}
					<view class="iconfont icon-Order-Details-SeeMore" :style="{'transform':isCustomerInfoMore?'rotate(180deg)':''}"></view>
				</view>
			</view>
		</view>
		
		<view class="zcModel-title zcJustifyC_between">客户标签</view>
		<block v-for="(item,index) in VehicleInfo.customerLebal" :key="index">
			<view class="uni-flex zcFlex_column" style="background-color: #FFFFFF;border-bottom: 3px solid #f8f8f8;">
				<view class="uni-flex zcJustifyC_between zcAlignI_center" style="padding: 20upx;">
					<view>{{item.title}}：</view>
					<input class="uni-flex-item" disabled="true" style="margin: 0 30upx;" type="text" :value="item.aValue" />
					<view @tap="zcPopupShow(index,item.isShow)" class="iconfont icon-sanjiaojiantoutriangular-copy"></view>
				</view>
				<view v-show="item.isShow" class="popup_content">
					<block v-for="(item1,idx) in item.list" :key="idx">
						<view :data-popupId="index" class="popup_item" :class="{active:item.actives.indexOf(idx) !== (-1)}" :id="idx" :style="{'flex': '0 0 '+item.row+'%'}" @tap="doChenkItem">{{item1.Name}}</view>
					</block>
				</view>
			</view>
		</block>
		
		
		<view v-show="!isNewCar">
			<view class="zcModel-title zcJustifyC_between"><view class="uni-flex zcAlignI_center">保单信息<view @tap.stop="getInsureOrder" style="color: #3CA4F9;border-bottom: 1upx solid #3CA4F9;font-size: 20upx;padding: 10upx 0;line-height: 1;margin-left: 20upx;height: 100%;box-sizing: border-box;">获取保单信息</view></view> <navigator :url="'../insure_history/insure_history?VehicleInfoSN='+VehicleInfoSN" class="iconfont icon-unie6a3 uni-flex zcAlignI_center">投保历史</navigator></view>
		</view>
		<view v-show="!isNewCar" class="zcDisabled">
			<block v-for="(item4,idx4) in VehicleInfo.policyInfo" :key="idx4" >
				<zc-card :zcIndex="idx4" :cardItem="item4" @zcChengeValue="zcChangeValue4"></zc-card>
			</block>
		</view>
		<view v-show="!isNewCar">
			<view class="zcModel-title zcJustifyC_between">回访信息<navigator :url="'../visit_history/visit_history?VehicleVIN='+VehicleInfo.vehicleInfo[1].value" class="iconfont icon-unie6a3 uni-flex zcAlignI_center">回访历史</navigator></view>
		</view>
		<view v-show="!isNewCar" class="zcDisabled">
			<block v-for="(item5,idx5) in VehicleInfo.visitInfo" :key="idx5" >
				<zc-card :zcIndex="idx5" :cardItem="item5" @zcChengeValue="zcChangeValue5"></zc-card>
			</block>
		</view>
		<!-- 附件信息 -->
		<view class="zcModel-title zcJustifyC_between">附件信息</view>
		<view class="uni-flex zcAlignI_center zcJustifyC_between zcCustomPhoto" style="width: 100%;padding: 0 10upx;box-sizing: border-box;">
			<block v-for="(img,index) in VehicleInfo.Files" :key="index">
				<zc-up-photo :isOne="true" :maxlength="1" :initBgImg="img.bgImag" :image="img" :zcId="img.id" @upImage="upImage" @rmImage="rmImage" ></zc-up-photo>
			</block>
		</view>
		
		<view class="zcModel-title zcJustifyC_between">其他附件信息</view>
		<zc-up-photo :image="VehicleInfo.img" :initBgImg="VehicleInfo.img.bgImag" :zcId="VehicleInfo.img.id" @upImage="upImage" @rmImage="rmImage" ></zc-up-photo>
		
		<view class="zcFooter-but uni-flex">
			<button @tap="zcSaveCustomer">保存</button>
		</view>
		
		<zc-custom-picker 
			:isShow="carCity.cpIsShow"
			:cpIsBottomBox="carCity.cpIsBottomBox"
			:cpnumber="4"
			:cpitem1="carCity.cpitem1" 
			:cpitem2="carCity.cpitem2" 
			:cpitem3="carCity.cpitem3" 
			:cpitem4="carCity.cpitem4" 
			:cpvalue1="carCity.cpvalue1" 
			:cpvalue2="carCity.cpvalue2" 
			:cpvalue3="carCity.cpvalue3"
			:cpvalue4="carCity.cpvalue4"
			@cpConfirm="cpConfirm"
			@cpbindChange="cpbindChange">
		</zc-custom-picker>
		
		<zc-custom-picker
			:isShowBox="carType.isShowBox"
			:boxId="carType.boxId"
			:cpitem1="carType.cpitem1" 
			:cpitem2="carType.cpitem2" 
			:cpitem3="carType.cpitem3" 
			:cpitem4="carType.cpitem4" 
			@zcItemClick="zcItemClick"
			@zcClickValue="zcClickValue">
		</zc-custom-picker>
		
	</view>
</template>

<script>
	import zcCard from "../../components/zc-card/zc-card.vue"
	import zcUpPhoto from "../../components/zc-upPhoto/zc-upPhoto.vue"
	import zcCustomPicker from "../../components/zcCustom_picker/zcCustom-picker.vue"
	
	let _this;
	export default {
		components:{
			zcCard,
			zcUpPhoto,
			zcCustomPicker
		},
		data() {
			return {
				imgPath:this.$ZcPublic.Domain,
				VehicleInfoSN:'',
                isNewCar: false,
				scrollTop:0,
				scrollNum:0,
				isCarInfoMore:false,
				CarInfoMoreText:'车辆详细信息',
				isCustomerInfoMore:false,
				CustomerInfoMoreText:'客户详细信息',
				VehicleInfo:'',
				// 自定义 弹出层数据
				carCity:{
					id:0,
					cpIsShow:false,
					cpIsBottomBox:true,
					cpitem1:[],
					cpitem2:[],
					cpitem3:[],
					cpitem4:[],
					cpvalue1:0,
					cpvalue2:0,
					cpvalue3:0,
					cpvalue4:0
				},
				carType:{
					isShowBox:false,
					boxId:0,
					cpitem1:[],
					cpitem2:[],
					cpitem3:[],
					cpitem4:[]
				}
			}
		},
		onLoad(e) {
			_this = this;
			uni.showLoading({
				title: '加载中',
				mask: true
			});
			if (e.VehicleInfoSN) {
				_this.VehicleInfoSN = e.VehicleInfoSN;
			}
			_this.zcGetVehicleInfo();
		},
		onPageScroll(res) {
			_this.scrollTop = res.scrollTop;
		},
		methods: {
			// 	车辆信息 输入
			zcChangeValue1(res) {
				
				if (res.id === 0) {
					if (!_this.checkVehiclePlateNo(res.value)) {
						uni.showModal({
							title: '温馨提示',
							content: '尊敬的用户，您输入车牌号有误，请重新输入！',
							showCancel: false
						});
						return;
					}
				}
				
				if (res.id === 1) {
					//  通过 车架号查询 车型
					if (res.value.length != 17) {
						uni.showModal({
							title: '温馨提示',
							content: '尊敬的用户，您输入的VIN码有误，请重新输入！',
							showCancel: false
						});
						return;
					}
					if (res.value === _this.VehicleInfo.vehicleInfo[1].value) {
						_this.zcqueryExternalCardModelByVIN(res.value,true);
					}else {
						_this.zcqueryExternalCardModelByVIN(res.value,false);
					}
				}
				if (res.id === 3 && res.value) {
					_this.VehicleInfo.vehicleInfo[4].value = _this.getVehicleRegistryDate(res.value);
					_this.VehicleInfo.vehicleInfoMore[0].value = res.value;
				}
				_this.VehicleInfo.vehicleInfo[res.id].value = res.value;
			},
			// 	车辆信息 更多
			zcChangeMoreValue(res) {
				// console.log('车辆其他信息 = ',res);
				if (res.id === 10) {
					if (res.value[0] === '是否精典新车') {
						_this.VehicleInfo.vehicleInfoMore[res.id].optionBoxs[0].isBoxCheck = true;
					}else if (!res.value[0]) {
						_this.VehicleInfo.vehicleInfoMore[res.id].optionBoxs[0].isBoxCheck = false;
					}
					return;
				}
				_this.VehicleInfo.vehicleInfoMore[res.id].value = res.value;
			},
			//  客户信息 输入
			zcChangeValue2(res) {
				if (res.id === 0 && _this.VehicleInfo['IsVehicleOwner']) {
					_this.VehicleInfo['VehicleOwnerName'] = res.value;
				} else if (res.id === 1) {
                    if (_this.VehicleInfo['IsVehicleOwner']) {
                        _this.VehicleInfo['VehicleOwnerCardType'] = res.value;
                    }
                    
                    if (_this.VehicleInfo.customerInfo[1].picker[res.value] == '身份证') {
                        if (_this.VehicleInfo.customerInfo[2].value) {
                            let IdCardInfo = _this.getIdCardInfo(_this.VehicleInfo.customerInfo[2].value);
                            if (IdCardInfo) {
                                 _this.VehicleInfo['customerInfoMore'][1].value = IdCardInfo.birthday;
                                 _this.VehicleInfo['customerInfoMore'][2].value = ''+(IdCardInfo.gender==='男'?0:1);
                                 _this.VehicleInfo['customerInfoMore'][3].value = IdCardInfo.age;
                            } 
                        }
                    }
				    
				} else if (res.id === 2) {
                    _this.VehicleInfo.customerInfo[res.id].value = res.value;
                    if (_this.VehicleInfo['IsVehicleOwner']) {
                        _this.VehicleInfo['VehicleOwnerCardNo'] = res.value;
                    }
                    
					if (_this.VehicleInfo['customerInfo'][1].picker[_this.VehicleInfo['customerInfo'][1].value] == '身份证' || _this.VehicleInfo['customerInfo'][1].picker[_this.VehicleInfo['customerInfo'][1].value] == '统一信用代码') {
					   if (res.value && res.value.length != 18) {
					   	uni.showModal({
					   		title: '温馨提示',
					   		content: '尊敬的用户，您输入的证件号位数有误，请重新输入！',
					   		showCancel: false
					   	});
					   	return
					   } 
					}
					
                    if (_this.VehicleInfo['customerInfo'][1].picker[_this.VehicleInfo['customerInfo'][1].value] == '身份证') {
                        let IdCardInfo = _this.getIdCardInfo(res.value);
                        if (IdCardInfo) {
                        	_this.VehicleInfo['customerInfoMore'][1].value = IdCardInfo.birthday;
                        	_this.VehicleInfo['customerInfoMore'][2].value = ''+(IdCardInfo.gender==='男'?0:1);
                        	_this.VehicleInfo['customerInfoMore'][3].value = IdCardInfo.age;
                        }
                    }
                    
				}else if (res.id === 3 && _this.VehicleInfo['IsVehicleOwner']) {
					_this.VehicleInfo['VehicleOwnerTelephone'] = res.value;
				}
			},
			zcChangeMore2Value(res) {
                if (res.id === 5 && res.value && _this.VehicleInfo['IsVehicleOwner']) {
                	_this.VehicleInfo['VehicleOwnerAddress'] = res.value;
                }
				if (res.id === 7) {
					if (res.value[0] === '客户免打扰') {
						_this.VehicleInfo.customerInfoMore[res.id].optionBoxs[0].isBoxCheck = true;
					}else if (!res.value[0]) {
						_this.VehicleInfo.customerInfoMore[res.id].optionBoxs[0].isBoxCheck = false;
					}
					return;
				}
				_this.VehicleInfo.customerInfoMore[res.id].value = res.value;
			},
			// 	输入框 点击事件
			zcInputClick(res) {
				// console.log('自定义弹出层  = ',res);
				if (res.id === 6) {
					_this.zcGetCarModel('','','','');
				}
				if (res.id === 4) {
					_this.carCity.id = res.id;
					_this.zcGetCarAdderss('ShenFen','')
				}
			},
			// 车型 选择后子弹出层状态操作
			zcItemClick(res) {
				// console.log('点击 = ',res);
				if (res.isShowBox === false) {
					_this.carType.isShowBox = false;
				}else{
					let name1 = '';
					let name2 = '';
					let name3 = '';
					let name4 = '';
					// _this.carType.boxId = res.boxId;
					if (res.boxId === 1) {
						name1 = _this.carType.cpitem1[res.value[0]].name;
					}else if (res.boxId === 2) {
						name1 = _this.carType.cpitem1[res.value[0]].name;
						name2 = _this.carType.cpitem2[res.value[1]].name;
					}else if (res.boxId === 3) {
						name1 = _this.carType.cpitem1[res.value[0]].name;
						name2 = _this.carType.cpitem2[res.value[1]].name;
						name3 = _this.carType.cpitem3[res.value[2]].name;
					}
					
					_this.zcGetCarModel(name1,name2,name3,name4);
				}
			},
			//  车型 选择完成后操作
			zcClickValue(res) {
				// console.log('车型值 = ',res);
				_this.carType.isShowBox = false;
				_this.carType.boxId = 0;
				_this.VehicleInfo.vehicleInfo[6].value = _this.carType.cpitem1[res[0]].name+'-'+_this.carType.cpitem2[res[1]].name+'-'+_this.carType.cpitem3[res[2]].name+'-'+_this.carType.cpitem4[res[3]].Year;
				_this.VehicleInfo.vehicleInfo[6].SN = _this.carType.cpitem4[res[3]].LyId;
                
                _this.VehicleInfo.VehicleType = _this.carType.cpitem2[res[1]].name;
                _this.VehicleInfo.VehicleMakeName = _this.carType.cpitem1[res[0]].name;
                _this.VehicleInfo.VehicleSerialName = _this.carType.cpitem3[res[2]].name;
                _this.VehicleInfo.VehicleMakeYear = _this.carType.cpitem4[res[3]].Year;
			},
			// 	地址选择监听操作
			cpbindChange(res) {
				// console.log('页面数据 = ',res);
				if (res[0] !== _this.carCity.cpvalue1) {
					if (_this.carCity.cpitem1[res[0]].SN) {
						_this.zcGetCarAdderss('City',_this.carCity.cpitem1[res[0]].SN);
					}
				}else if (res[1] !== _this.carCity.cpvalue2) {
					if (_this.carCity.cpitem2[res[1]].SN) {
						_this.zcGetCarAdderss('Xian',_this.carCity.cpitem2[res[1]].SN);
					}
				}else if (res[2] !== _this.carCity.cpvalue3) {
					if (_this.carCity.cpitem3[res[2]].SN) {
						_this.zcGetCarAdderss('Town',_this.carCity.cpitem3[res[2]].SN);
					}
				}
				_this.carCity.cpvalue1 = res[0];
				_this.carCity.cpvalue2 = res[1];
				_this.carCity.cpvalue3 = res[2];
				_this.carCity.cpvalue4 = res[3];
			},
			// 	地址选择操作
			cpConfirm(res) {
				if (res === 'cancel') {
					_this.carCity.cpIsShow = false;
				}else if (res === 'confirm') {
					_this.carCity.cpIsShow = false;
					if (_this.carCity.cpitem3.length>0 && _this.carCity.cpitem4.length>0) {
						_this.VehicleInfo['customerInfoMore'][4].value = _this.carCity.cpitem1[_this.carCity.cpvalue1].name+'-'+_this.carCity.cpitem2[_this.carCity.cpvalue2].name+'-'+_this.carCity.cpitem3[_this.carCity.cpvalue3].name+'-'+_this.carCity.cpitem4[_this.carCity.cpvalue4].name;
						_this.VehicleInfo['customerInfoMore'][4].SN = _this.carCity.cpitem4[_this.carCity.cpvalue4].SN;
                        if (_this.VehicleInfo['IsVehicleOwner']) {
                            _this.VehicleInfo['VehicleOwnerCity'] = _this.carCity.cpitem1[_this.carCity.cpvalue1].name+'-'+_this.carCity.cpitem2[_this.carCity.cpvalue2].name+'-'+_this.carCity.cpitem3[_this.carCity.cpvalue3].name+'-'+_this.carCity.cpitem4[_this.carCity.cpvalue4].name;
                            _this.VehicleInfo['VehicleOwnerCitySN'] = _this.carCity.cpitem4[_this.carCity.cpvalue4].SN;
                        }
					}else if (_this.carCity.cpitem3.length>0 && _this.carCity.cpitem4.length === 0) {
						_this.VehicleInfo['customerInfoMore'][4].value = _this.carCity.cpitem1[_this.carCity.cpvalue1].name+'-'+_this.carCity.cpitem2[_this.carCity.cpvalue2].name+'-'+_this.carCity.cpitem3[_this.carCity.cpvalue3].name;
						_this.VehicleInfo['customerInfoMore'][4].SN = _this.carCity.cpitem3[_this.carCity.cpvalue3].SN;
                        if (_this.VehicleInfo['IsVehicleOwner']) {
                            _this.VehicleInfo['VehicleOwnerCity'] = _this.carCity.cpitem1[_this.carCity.cpvalue1].name+'-'+_this.carCity.cpitem2[_this.carCity.cpvalue2].name+'-'+_this.carCity.cpitem3[_this.carCity.cpvalue3].name;
                            _this.VehicleInfo['VehicleOwnerCitySN'] = _this.carCity.cpitem3[_this.carCity.cpvalue3].SN;
                        }
					}else{
						_this.VehicleInfo['customerInfoMore'][4].value = _this.carCity.cpitem1[_this.carCity.cpvalue1].name+'-'+_this.carCity.cpitem2[_this.carCity.cpvalue2].name;
						_this.VehicleInfo['customerInfoMore'][4].SN = _this.carCity.cpitem2[_this.carCity.cpvalue2].SN;
                        if (_this.VehicleInfo['IsVehicleOwner']) {
                            _this.VehicleInfo['VehicleOwnerCity'] = _this.carCity.cpitem1[_this.carCity.cpvalue1].name+'-'+_this.carCity.cpitem2[_this.carCity.cpvalue2].name;
                            _this.VehicleInfo['VehicleOwnerCitySN'] = _this.carCity.cpitem2[_this.carCity.cpvalue2].SN;
                        }
					}
				}
			},
			//	正则验证 车牌号方法
			checkVehiclePlateNo(item) {
				return RegExp(/^(([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领非][A-Z](([0-9]{5}[DF])|([DF]([A-HJ-NP-Z0-9])[0-9]{4})))|([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领非][A-Z][A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳使领]))$/).test(item);
			},
			//  更多展开操作
			doCarInfoMore() {
				if (_this.CarInfoMoreText === '车辆详细信息') {
					_this.scrollNum = _this.scrollTop;
					_this.CarInfoMoreText = '收起';
				}else {
					_this.CarInfoMoreText = '车辆详细信息';
					uni.pageScrollTo({
						scrollTop:_this.scrollNum
					})
				}
				
				_this.isCarInfoMore = !_this.isCarInfoMore;
			},
			//  更多展开操作
			doCustomerInfoMore() {
				if (_this.CustomerInfoMoreText === '客户详细信息') {
					_this.scrollNum = _this.scrollTop;
					_this.CustomerInfoMoreText = '收起';
				}else {
					_this.CustomerInfoMoreText = '客户详细信息';
					uni.pageScrollTo({
						scrollTop:_this.scrollNum
					})
				}
				_this.isCustomerInfoMore = !_this.isCustomerInfoMore;
			},
			//标签 选中 操作
			doChenkItem(e) {	
				// console.log('当前选择：',_this.items3Infos[0]);
				let id  = parseInt(e.target.id);
				let popupId = parseInt(e.target.dataset.popupid);
				
				if (_this.VehicleInfo.customerLebal[popupId].isDisabled) {
					return;
				}
				
				// 多选
				//Array.indexOf(index);  表示Array数组中是否包含 index 值，包含则返回该值在数组中的下标，否则返回 -1
				if (_this.VehicleInfo.customerLebal[popupId].type === 'checkbox') {
					if (_this.VehicleInfo.customerLebal[popupId].actives.indexOf(id) !== (-1)) {
						for (let i = 0; i < _this.VehicleInfo.customerLebal[popupId].actives.length; i++) {
							if (_this.VehicleInfo.customerLebal[popupId].actives[i] === id) {
								//  当前选中的标签已经被选中了，所以进行删除选中标签相关
								_this.VehicleInfo.customerLebal[popupId].actives.splice(i,1);
								let new_aValue = _this.VehicleInfo.customerLebal[popupId].aValue.split(' , ');
								new_aValue.splice(i,1);
								_this.VehicleInfo.customerLebal[popupId].aValue = '';
								for (let a = 0; a < new_aValue.length; a++) {
									if (a === 0) {
										_this.VehicleInfo.customerLebal[popupId].aValue = new_aValue[a];
									}else {
										_this.VehicleInfo.customerLebal[popupId].aValue = _this.VehicleInfo.customerLebal[popupId].aValue +' , '+ new_aValue[a];
									}
								}
								if (_this.VehicleInfo.customerLebal[popupId].list[id].oS) {
									for (let k = 0; k < _this.VehicleInfo.customerLebal.length; k++) {
										if (_this.VehicleInfo.customerLebal[k].value === _this.VehicleInfo.customerLebal[popupId].list[id].Code) {
											_this.VehicleInfo.customerLebal.splice(k,1);	// 删除
										}
									}
								}
							}
						}
					}else {
						//  当前选中的标签 未选中，所以进行添加选中标签相关
						_this.VehicleInfo.customerLebal[popupId].actives.push(id);
						if (_this.VehicleInfo.customerLebal[popupId].aValue) {
							_this.VehicleInfo.customerLebal[popupId].aValue = _this.VehicleInfo.customerLebal[popupId].aValue+' , '+_this.VehicleInfo.customerLebal[popupId].list[id].Name;
						}else {
							_this.VehicleInfo.customerLebal[popupId].aValue = _this.VehicleInfo.customerLebal[popupId].list[id].Name;
						}
						
						
						if (_this.VehicleInfo.customerLebal[popupId].list[id].oS) {
							let item = {
								title:_this.VehicleInfo.customerLebal[popupId].list[id].oS[0].Name,
								Code:_this.VehicleInfo.customerLebal[popupId].list[id].oS[0].Code,
								isShow:true,
								value:_this.VehicleInfo.customerLebal[popupId].list[id].Code,
								row:48,
								isDisabled:false,
								type:'audio',
								info:_this.VehicleInfo.customerLebal[popupId].list[id].oS[0],
								actives:[],
								aValue:'',
								list:_this.VehicleInfo.customerLebal[popupId].list[id].oS[0].childs
							}
							if (_this.VehicleInfo.customerLebal[popupId].list[id].oS[0].sModel === '单选') {
								item.type = 'audio';
							}else if (_this.VehicleInfo.customerLebal[popupId].list[id].oS[0].sModel === '多选') {
								item.type = 'checkbox';
							}
							if (_this.VehicleInfo.customerLebal[popupId].list[id].oS[0].OnlyWrite) {
								item.isDisabled = true;
							}
							// _this.items3Infos[0].childs.splice((popupId+1),0,_this.items3Infos[0].childs[popupId].childs[id].oS[0]);
							_this.VehicleInfo.customerLebal.splice((popupId+1),0,item);
						}
					}
				}
				
				//  单选
				if (_this.VehicleInfo.customerLebal[popupId].type === 'audio') {
					if (_this.VehicleInfo.customerLebal[popupId].actives.length === 0) {
						_this.VehicleInfo.customerLebal[popupId].actives.push(id);
						_this.VehicleInfo.customerLebal[popupId].aValue = _this.VehicleInfo.customerLebal[popupId].list[id].Name;
						
						if (_this.VehicleInfo.customerLebal[popupId].list[id].oS) {
							let item = {
								title:_this.VehicleInfo.customerLebal[popupId].list[id].oS[0].Name,
								Code:_this.VehicleInfo.customerLebal[popupId].list[id].oS[0].Code,
								isShow:true,
								value:_this.VehicleInfo.customerLebal[popupId].list[id].Code,
								row:48,
								isDisabled:false,
								type:'audio',
								info:_this.VehicleInfo.customerLebal[popupId].list[id].oS[0],
								actives:[],
								aValue:'',
								list:_this.VehicleInfo.customerLebal[popupId].list[id].oS[0].childs
							}
							if (_this.VehicleInfo.customerLebal[popupId].list[id].oS[0].sModel === '单选') {
								item.type = 'audio';
							}else if (_this.VehicleInfo.customerLebal[popupId].list[id].oS[0].sModel === '多选') {
								item.type = 'checkbox';
							}
							if (_this.VehicleInfo.customerLebal[popupId].list[id].oS[0].OnlyWrite) {
								item.isDisabled = true;
							}
							// _this.items3Infos[0].childs.splice((popupId+1),0,_this.items3Infos[0].childs[popupId].childs[id].oS[0]);
							_this.VehicleInfo.customerLebal.splice((popupId+1),0,item);
						}
					}else {
						//  单选选中过值的，首先处理选中的值是否添加过 子标签，添加过则删除 。 然后处理但钱选中标签是否有 子标签，有则添加
						if (_this.VehicleInfo.customerLebal[popupId].list[_this.VehicleInfo.customerLebal[popupId].actives[0]].oS && _this.VehicleInfo.customerLebal[popupId].actives[0] !== id) {
							let array = JSON.parse(JSON.stringify(_this.VehicleInfo.customerLebal));
							for (var k = 0; k < array.length; k++) {
								if (array[k].value === array[popupId].list[array[popupId].actives[0]].Code) {
									_this.VehicleInfo.customerLebal.splice(k,1);	// 删除
								}
							}
							
							_this.VehicleInfo.customerLebal[popupId].actives = [];
							_this.VehicleInfo.customerLebal[popupId].actives.push(id);
							_this.VehicleInfo.customerLebal[popupId].aValue = _this.VehicleInfo.customerLebal[popupId].list[id].Name;
						}else if(_this.VehicleInfo.customerLebal[popupId].actives[0] !== id) {
							if (_this.VehicleInfo.customerLebal[popupId].list[id].oS) {
								let item = {
									title:_this.VehicleInfo.customerLebal[popupId].list[id].oS[0].Name,
									Code:_this.VehicleInfo.customerLebal[popupId].list[id].oS[0].Code,
									isShow:true,
									value:_this.VehicleInfo.customerLebal[popupId].list[id].Code,
									row:48,
									isDisabled:false,
									type:'audio',
									info:_this.VehicleInfo.customerLebal[popupId].list[id].oS[0],
									actives:[],
									aValue:'',
									list:_this.VehicleInfo.customerLebal[popupId].list[id].oS[0].childs
								}
								if (_this.VehicleInfo.customerLebal[popupId].list[id].oS[0].sModel === '单选') {
									item.type = 'audio';
								}else if (_this.VehicleInfo.customerLebal[popupId].list[id].oS[0].sModel === '多选') {
									item.type = 'checkbox';
								}
								if (_this.VehicleInfo.customerLebal[popupId].list[id].oS[0].OnlyWrite) {
									item.isDisabled = true;
								}
								// _this.items3Infos[0].childs.splice((popupId+1),0,_this.items3Infos[0].childs[popupId].childs[id].oS[0]);
								_this.VehicleInfo.customerLebal.splice((popupId+1),0,item);
							}
							
							_this.VehicleInfo.customerLebal[popupId].actives = [];
							_this.VehicleInfo.customerLebal[popupId].actives.push(id);
							_this.VehicleInfo.customerLebal[popupId].aValue = _this.VehicleInfo.customerLebal[popupId].list[id].Name;
						}else {
							if (_this.VehicleInfo.customerLebal[popupId].list[_this.VehicleInfo.customerLebal[popupId].actives[0]].oS) {
								let array = JSON.parse(JSON.stringify(_this.VehicleInfo.customerLebal));
								for (var k = 0; k < array.length; k++) {
									if (array[k].value === array[popupId].list[array[popupId].actives[0]].Code) {
										_this.VehicleInfo.customerLebal.splice(k,1);	// 删除
									}
								}
							}
							_this.VehicleInfo.customerLebal[popupId].aValue = '';
							_this.VehicleInfo.customerLebal[popupId].actives = [];
						}
						
						
					}
				}
			},
			//标签 操作
			zcPopupShow(index,bl) {		// 显示隐藏 标签选项
				_this.VehicleInfo.customerLebal[index].isShow = !bl;
			},
			upImage(res) {
				// console.log('upImage8 = ',res);
				switch (res.id){
					case 1:
						_this.VehicleInfo.Files[0].images = res.images;
						_this.VehicleInfo.Files[0].imgInfos = res.imgInfos;
						break;
					case 2:
						_this.VehicleInfo.Files[1].images = res.images;
						_this.VehicleInfo.Files[1].imgInfos = res.imgInfos;
						break;
					case 3:
						_this.VehicleInfo.Files[2].images = res.images;
						_this.VehicleInfo.Files[2].imgInfos = res.imgInfos;
						break;
					case 4:
						_this.VehicleInfo.Files[3].images = res.images;	
						_this.VehicleInfo.Files[3].imgInfos = res.imgInfos;
						break;
					case 5:
						_this.VehicleInfo.Files[4].images = res.images;
						_this.VehicleInfo.Files[4].imgInfos = res.imgInfos;
						break;
					case 6:
						_this.VehicleInfo.Files[5].images = res.images;
						_this.VehicleInfo.Files[5].imgInfos = res.imgInfos;
						break;
					case 7:
						_this.VehicleInfo.Files[6].images = res.images;
						_this.VehicleInfo.Files[6].imgInfos = res.imgInfos;
						break;
					case 8:
						_this.VehicleInfo.img.images = res.images;
						_this.VehicleInfo.img.imgInfos = res.imgInfos;
						break;
					default:
						break;
				}
			},
			rmImage(res) {
				// console.log('sc = ',res);
				switch (res.id){
					case 1:
						_this.VehicleInfo.Files[0].images.splice(res.index,1);
						break;
					case 2:
						_this.VehicleInfo.Files[1].images.splice(res.index,1);
						break;
					case 3:
						_this.VehicleInfo.Files[2].images.splice(res.index,1);
						break;
					case 4:
						_this.VehicleInfo.Files[3].images.splice(res.index,1);
						break;
					case 5:
						_this.VehicleInfo.Files[4].images.splice(res.index,1);
						break;
					case 6:
						_this.VehicleInfo.Files[5].images.splice(res.index,1);
						break;
					case 7:
						_this.VehicleInfo.Files[6].images.splice(res.index,1);
						break;
					case 8:
						_this.VehicleInfo.img.images.splice(res.index,1);
						break;
					default:
						break;
				}
			},
			
			// ----------------------
			// 	接口区
			//  获取车型（新车， 备注：通过用户输入 车架VIN码后查询）
			zcqueryExternalCardModelByVIN(VIN,is) {
				if (is) {
					return;
				}
				uni.showLoading({
					title: '加载中',
					mask: true
				});
				_this.$ZcPublic.Server.Post({
					IsNeedLogin: true,
					Paras: {
						Name: 'uni_Insure_Detail',
						Action: 'Ext_queryExternalCardModelByVIN',
						Data: {
							vin:VIN,
						}
					},
					Callback:function(resjson,scope) {
						if (resjson.state === 'back') {
							// console.log('获取车型(新车) ：',resjson.data);
							if (!resjson.success) {
								uni.showModal({
									title:'温馨提示',
									showCancel:false,
									content:''+resjson.msg
								})
								return;
							}
							let name = '';
							if (resjson.data.VehicleMakeName) {	//	车型品牌
								name = resjson.data.VehicleMakeName;
								if (resjson.data.VehicleSerialName) {	//	车型系列
									name = name+'-'+resjson.data.VehicleSerialName;
									if (resjson.data.VehicleType) {	//	车型
										name = name+'-'+resjson.data.VehicleType;
										if (resjson.data.VehicleMakeYear) {	//	年款
											name = name+'-'+resjson.data.VehicleMakeYear;
										} 
									} 
								} 
							} 
							
							if (resjson.data.VehicleSeatCount) {	//	座位数
								_this.VehicleInfo.vehicleInfoMore[1].value = resjson.data.VehicleSeatCount;
							} 
							if (name) {
								_this.VehicleInfo.vehicleInfo[6].value = name;
							}
							
							if (resjson.data.VehicleDisplacement) {	//	排量
								_this.VehicleInfo.vehicleInfo[8].value = resjson.data.VehicleDisplacement;
							} 
							if (resjson.data.VehiclePrice) {	//	新车购置价
								_this.VehicleInfo.VehiclePrice = resjson.data.VehiclePrice;
							}
							
						}
                        if (resjson.state === 'end') {
                            uni.hideLoading();
                        }
					},
					Scope: this
				});
			},
			// 	获取车型 （旧车）
			zcGetCarModel(BName,SName,Name,YName) {	
				uni.showLoading({
					title: '加载中',
					mask: true
				});
				_this.$ZcPublic.Server.Post({
					IsNeedLogin: true,
					Paras: {
						Name: 'uni_Insure_Detail',
						Action: 'Ext_GetCarModel',
						Data: {
							BName:BName,
							SName:SName,
							Name:Name,
							YName:YName,
						}
					},
					Callback:function(resjson,scope) {
						if (resjson.state === 'back') {
							// console.log('获取车型 ：',resjson.data);
							if (!resjson.success) {
								uni.showModal({
									title:'温馨提示',
									showCancel:false,
									content:''+resjson.msg
								})
								return;
							}
							if (resjson.data!==null&&resjson.data.length>0) {
								_this.carType.isShowBox = true;
								
								if (!BName && !SName && !Name && !YName) {
									_this.carType.cpitem1 = resjson.data;
									_this.carType.cpitem2 = [];
									_this.carType.cpitem3 = [];
									_this.carType.cpitem4 = [];
								}else if (BName && !SName && !Name && !YName) {
									_this.carType.cpitem2 = resjson.data;
									_this.carType.cpitem3 = [];
									_this.carType.cpitem4 = [];
								}else if (SName && BName && !Name && !YName) {
									_this.carType.cpitem3 = resjson.data;
									_this.carType.cpitem4 = [];
								}else if (Name && BName && SName && !YName) {
									_this.carType.cpitem4 = resjson.data;
								}
								
							}
						}
                        if (resjson.state === 'end') {
                            uni.hideLoading();
                        }
					},
					Scope: this
				});
			},
			// 	获取车主地址
			zcGetCarAdderss(type,SN) {	
				uni.showLoading({
					title: '加载中',
					mask: true
				});
				_this.$ZcPublic.Server.Post({
					IsNeedLogin: true,
					Paras: {
						Name: 'Uni_Area',
						Action: ''+type,
						Data: {
							SN:SN,
						}
					},
					Callback:function(resjson,scope) {
						// console.log('获取车主地址 ：',resjson.data);
						if (resjson.state === 'back') {
							if (!resjson.success) {
								uni.showModal({
									title:'温馨提示',
									showCancel:false,
									content:''+resjson.msg
								})
								return;
							}
							if (resjson.data !== null) {
								_this.carCity.cpIsShow = true;
								let list = [];
								if (resjson.data.length > 0) {
									for (let i = 0; i < resjson.data.length; i++) {
										let item = {
											name:resjson.data[i].Name,
											SN:resjson.data[i].SN
										}
										list.push(item);
									}
								}
								if (type === 'ShenFen') {
									_this.carCity.cpitem1 = list;
									_this.carCity.cpvalue1 = 0;
									_this.carCity.cpvalue2 = 0;
									_this.carCity.cpvalue3 = 0;
									_this.carCity.cpvalue4 = 0;
									if (list.length > 0) {
										_this.zcGetCarAdderss('City',list[0].SN);
									}
									
								}else if (type === 'City') {
									_this.carCity.cpitem2 = list;
									_this.carCity.cpvalue2 = 0;
									_this.carCity.cpvalue3 = 0;
									_this.carCity.cpvalue4 = 0;
									if (list.length > 0) {
										_this.zcGetCarAdderss('Xian',list[0].SN);
									}
								}else if (type === 'Xian') {
									_this.carCity.cpitem3 = list;
									_this.carCity.cpvalue3 = 0;
									_this.carCity.cpvalue4 = 0;
									if (list.length > 0) {
										_this.zcGetCarAdderss('Town',list[0].SN);
									}
								}else if (type === 'Town') {
									_this.carCity.cpvalue4 = 0;
									_this.carCity.cpitem4 = list;
								}
							}
						}
                        if (resjson.state === 'end') {
                            uni.hideLoading();
                        }
					},
					Scope: this
				});
			},
			// 	获取保单信息
			getInsureOrder() {
				if (!_this.VehicleInfo['vehicleInfo'][0].value) {
					uni.showModal({
						title: '温馨提示',
						content: '尊敬的用户，请输入车牌号！',
						showCancel: false
					});
					return;
				}
				if (!_this.VehicleInfo['vehicleInfo'][1].value) {
					uni.showModal({
						title: '温馨提示',
						content: '尊敬的用户，请输入车架号！',
						showCancel: false
					});
					return;
				}
				
				_this.$ZcPublic.Server.Post({
					IsNeedLogin: true,
					Paras: {
						Name: 'uni_Insure_Detail',
						Action: 'Ext_getVehicleLastInsurePolicy',
						Data: {
							VehiclePlateNo:_this.VehicleInfo['vehicleInfo'][0].value,
							VehicleVIN:_this.VehicleInfo['vehicleInfo'][1].value,
							VehicleOwnerName:_this.VehicleInfo['VehicleOwnerName']
						}
					},
					Callback:function(resjson,scope) {
						if (resjson.state === 'back') {
							console.log('客户保单信息 ：',resjson.data);
							if (!resjson.success) {
								uni.showModal({
									title:'温馨提示',
									showCancel:false,
									content:''+resjson.msg
								})
								return;
							}
							
							if (resjson.data !== null) {
								// 保单信息 数据初始化
								if (!resjson.data.InsureStartDate) {
									resjson.data.InsureStartDate = '';
								}else if (!resjson.data.InsureEndDate) {
									resjson.data.InsureEndDate = '';
								}else {
									_this.VehicleInfo['policyInfo'][0].value = resjson.data.InsureStartDate+' ~ '+resjson.data.InsureEndDate;	//保险有效期
								}
								
								_this.VehicleInfo['policyInfo'][1].value = resjson.data.InsureCompany;	//保险公司
								_this.VehicleInfo['policyInfo'][2].value = resjson.data.InsureMoney;	//保费
							}else {
								uni.showModal({
									title: '温馨提示',
									content: '尊敬的用户，您暂无投保信息！',
									showCancel: false
								});
							}
						} else{
							
						}
						
					},
					Scope: this
				});
			},
			// 	获取 车辆信息
			zcGetVehicleInfo() {
				uni.showLoading({
					title: '加载中',
					mask: true
				});
				_this.$ZcPublic.Server.Post({
					IsNeedLogin: true,
					Paras: {
						Name: 'uni_Insure_Detail',
						Action: 'Ext_GetVehicleInfo',
						Data: {
							SN:_this.VehicleInfoSN
						}
					},
					Callback:function(resjson,scope) {
						if (resjson.state === 'back') {
							console.log('我的客户 详情 = ',resjson.data);
							if (!resjson.success) {
								uni.showModal({
									title:'温馨提示',
									showCancel:false,
									content:''+resjson.msg
								})
								return;
							}
							
							if (resjson.data) {
                                _this.isNewCar = resjson.data.VehicleIsNewCar;
								_this.VehicleInfo = _this.getDataInit(resjson.data);
							}
						} else{
							uni.hideLoading();
						}
						
					},
					Scope: this
				})
			},
			// 保存 / 报价
			zcSaveCustomer(index) {
				
				let vehicleInfo = {};
				let list = [];
				let images = [];
                
                let zcId = 0;
                if (!_this.isNewCar) {
                	if (!_this.VehicleInfo.vehicleInfo[0+zcId].value) {uni.showModal({title: '温馨提示',content: '尊敬的用户,请输入车牌号！',showCancel: false});return;};
                	if (!_this.checkVehiclePlateNo(_this.VehicleInfo.vehicleInfo[0+zcId].value)) {uni.showModal({title: '温馨提示',content: '尊敬的用户，您输入车牌号有误，请重新输入！',showCancel: false});return;};
                }
                
                if (!_this.VehicleInfo.vehicleInfo[1+zcId].value) {uni.showModal({title: '温馨提示',content: '尊敬的用户,请输入VIN码！',showCancel: false});return;};
                if (_this.VehicleInfo.vehicleInfo[1+zcId].value.length != 17) {uni.showModal({title: '温馨提示',content: '尊敬的用户，您输入的VIN码位数有误，请重新输入！',showCancel: false});return;};
                if (!_this.VehicleInfo.vehicleInfo[2+zcId].value) {uni.showModal({title: '温馨提示',content: '尊敬的用户,请输入发动机号！',showCancel: false});return;};
                if (!_this.VehicleInfo.vehicleInfo[3+zcId].value) {uni.showModal({title: '温馨提示',content: '尊敬的用户,请输入初登日期！',showCancel: false});return;};
                if (!_this.VehicleInfo.vehicleInfo[4+zcId].value) {uni.showModal({title: '温馨提示',content: '尊敬的用户,请输入保险到期日期！',showCancel: false});return;};
                if (!_this.VehicleInfo.vehicleInfo[5+zcId].value) {uni.showModal({title: '温馨提示',content: '尊敬的用户,请输入厂牌！',showCancel: false});return;};
                if (!_this.VehicleInfo.vehicleInfo[6+zcId].value) {uni.showModal({title: '温馨提示',content: '尊敬的用户,请选择车型！',showCancel: false});return;};
                if (!_this.VehicleInfo.vehicleInfo[7+zcId].value) {uni.showModal({title: '温馨提示',content: '尊敬的用户,请输入车型编码！',showCancel: false});return;};
                
                if (!_this.VehicleInfo.customerInfo[0].value) {uni.showModal({title: '温馨提示',content: '尊敬的用户,请输入客户姓名！',showCancel: false});return;};
                if (_this.VehicleInfo.customerInfo[1].value == '身份证' || _this.VehicleInfo.customerInfo[1].value == '统一信用代码') {
                   if (_this.VehicleInfo.customerInfo[2].value && _this.VehicleInfo.customerInfo[2].value.length !== 18) {uni.showModal({title: '温馨提示',content: '尊敬的用户,请输入18位客户证件号！',showCancel: false});return;}; 
                }
                if (_this.VehicleInfo.customerInfo[1].picker[_this.VehicleInfo.customerInfo[1].value] == '身份证') {
                    if (_this.VehicleInfo.customerInfo[2].value) {
                       let IdCardInfo = _this.getIdCardInfo(_this.VehicleInfo.customerInfo[2].value);
                       if (!IdCardInfo.bl) {return;} 
                    }
                }
                if (!_this.VehicleInfo.customerInfo[3].value) {uni.showModal({title: '温馨提示',content: '尊敬的用户,请输入客户电话！',showCancel: false});return;};
                if (_this.VehicleInfo.customerInfo[3].value.length !== 11) {uni.showModal({title: '温馨提示',content: '尊敬的用户,请输入11位客户电话！',showCancel: false});return;};
                
                
				for (let item in _this.VehicleInfo) {
					if (_this.VehicleInfo[item] && _this.VehicleInfo[item].constructor === Object) {
						// 其他 图片附件处理
						if (_this.VehicleInfo[item]['imgInfos'].length > 0) {
							for (let i = 0; i < _this.VehicleInfo[item]['imgInfos'].length; i++) {
								let imgItem = {
									VehicleInfoSN: _this.VehicleInfo['SN'],
									PB_ComAttSN: _this.VehicleInfo[item]['imgInfos'][i].SN,
									PB_ComAttURL: _this.VehicleInfo[item]['imgInfos'][i].LUrl,
									UpLoadFileName: _this.VehicleInfo[item]['imgInfos'][i].FileName,
									FileType:_this.VehicleInfo[item]['name']
								}
								images.push(imgItem);
								vehicleInfo['Files'] = images;
							}
						}
					}else if (_this.VehicleInfo[item] && _this.VehicleInfo[item].constructor === Array) {
						for (let i = 0; i < _this.VehicleInfo[item].length; i++) {
							if (item !== 'Files' && item !== 'customerLebalInfo' && item !== 'customerLebal') {
								for (let item1 in _this.VehicleInfo[item][i]) {
									if (_this.VehicleInfo[item][i]['type'] === 'picker' && _this.VehicleInfo[item][i]['mode'] !== 'date') {
										if (item1 === 'value') {
											vehicleInfo[_this.VehicleInfo[item][i]['name']] = _this.VehicleInfo[item][i].picker[parseInt(_this.VehicleInfo[item][i][item1])];
										}
									}else {
										if (item1 === 'value') {
											if (_this.VehicleInfo[item][i]['type'] === 'checkbox') {
												vehicleInfo[_this.VehicleInfo[item][i]['name']] = _this.VehicleInfo[item][i].optionBoxs[0].isBoxCheck;
											}else {
												if (_this.VehicleInfo[item][i]['mode'] === 'multTime') {
													if (_this.VehicleInfo[item][i][item1].split('~').length>1) {
														vehicleInfo['InsureStartDate'] = _this.VehicleInfo[item][i][item1].split('~')[0];
													}
												}else {
												    vehicleInfo[_this.VehicleInfo[item][i]['name']] = _this.VehicleInfo[item][i][item1];
												}
												if (_this.VehicleInfo[item][i]['SNName']) {
													vehicleInfo[_this.VehicleInfo[item][i]['SNName']] = _this.VehicleInfo[item][i]['SN'];
												}
											}
										}
									}
								}
							}else if (item === 'customerLebal') {
								if (_this.VehicleInfo[item][i].actives.length > 0) {
									for (var k = 0; k < _this.VehicleInfo[item][i].actives.length; k++) {
										let SN = _this.VehicleInfo[item][i].list[_this.VehicleInfo[item][i].actives[k]].SN;
										list.push(SN);
										vehicleInfo['SaveLabels'] = list;
									}
								}
							}else if (item === 'Files') {
								if (_this.VehicleInfo[item][i]['imgInfos'].length > 0) {
									for (let j = 0; j < _this.VehicleInfo[item][i]['imgInfos'].length; j++) {
										let imgItem = {
											VehicleInfoSN: _this.VehicleInfo['SN'],
											PB_ComAttSN: _this.VehicleInfo[item][i]['imgInfos'][j].SN,
											PB_ComAttURL: _this.VehicleInfo[item][i]['imgInfos'][j].LUrl,
											UpLoadFileName: _this.VehicleInfo[item][i]['imgInfos'][j].FileName,
											FileType:_this.VehicleInfo[item][i]['name']
										}
										images.push(imgItem);
										vehicleInfo['Files'] = images;
									}
								}
							}
						}
					}else {
						vehicleInfo[item] = _this.VehicleInfo[item];
					}
				}
				
				if (!vehicleInfo.InsureMoney) {
					vehicleInfo.InsureMoney = 0;
				}
                if (!vehicleInfo.CustomerAge) {vehicleInfo.CustomerAge = 0;}
                if (vehicleInfo.VehiclePlateNoIsWrong) {
                    vehicleInfo.IsDuplicatedVIN = true;
                }
                
				console.log('保存数据 = ',vehicleInfo);
				
				// return;
				_this.$ZcPublic.Server.Post({
					IsNeedLogin: true,
					Paras: {
						Name: 'uni_Insure_Detail',
						Action: 'Ext_SaveVehicleInfo',
						Data: vehicleInfo
					},
					Callback:function(resjson,scope) {
						if (resjson.state === 'back') {
							console.log('保存成功 = ',resjson);
							if (!resjson.success) {
								uni.showModal({
									title:'温馨提示',
									showCancel:false,
									content:''+resjson.msg
								})
								return;
							}
							uni.showToast({
								title: '保存成功'
							});
							
							uni.navigateBack();
						} else{
							
						}
					},
					Scope: this
				});
			},
			
			
			// 	-------END----------
			//  根据 初登日期  处理 保险到期日期
			getVehicleRegistryDate(val) {
				let newDate = new Date();                                    
				let monthNow = newDate.getMonth()+1;
				let yearNow = newDate.getFullYear();
				var dateNow = newDate.getDate();
			
				let RegistryDate = new Date(val);
				
				let valMonth = RegistryDate.getMonth()+1;
				let valYear = RegistryDate.getFullYear();
				let valDate = RegistryDate.getDate();
				
				newDate = new Date(yearNow, monthNow, dateNow);
				if (newDate.getTime() > RegistryDate.getTime()) {
					//当前日期大于初登日期
					if (monthNow == valMonth) {//月份                                              
						if (dateNow >= valDate) {
						    yearNow = yearNow+1;
						} 
					}else if (monthNow > valMonth) {
					    yearNow = yearNow+1; 
					}
				}else if (newDate.getTime() == RegistryDate.getTime()) {
				    yearNow = yearNow+1; 
				}
				if (valMonth < 10) {
					valMonth = '0'+valMonth;
				}
				if (valDate < 10) {
					valDate = '0'+valDate;
				}
				return yearNow+'-'+valMonth+'-'+valDate;
			},
			// 	处理 身份证自动识别  生日、性别 、年龄 方法
			formateDateCN: function ( day ,IsYear) {
				let isObj = false;
				
				let yyyy = day.substring( 0, 4 );
				let mm = day.substring( 4, 6 );
				let dd = day.substring( 6 );
				if ((parseInt(yyyy) < 1900 || parseInt(yyyy) > 2220) || (parseInt(mm) < 1 || parseInt(mm) > 12) || (parseInt(dd) < 1 || parseInt(dd) > 31)) {
					isObj = true;
				}
				if (isObj) {
					uni.showModal({
					    title: '温馨提示',
						content: '尊敬的用户，你输入的身份证有误，请确认并修改！',
					    showCancel: false
					});
					return false;
				}
				
				if ( IsYear ) {
					return + mm + '-' + dd;
				} else {
					return yyyy + '-' + mm + '-' + dd;
				}
			},
			// 	处理 身份证自动识别  生日、性别 、年龄 方法
			getIdCardInfo(idCardNo,IsYear) {
				if (!idCardNo) {
					return;
				}
				let idCardInfo = {
						age:0,
						gender: "",  //性别
						birthday: "" ,// 出生日期(yyyy-mm-dd)/mm-dd
                        bl:true
					};
				let aday = "";
				if (idCardNo.length == 15 ) {
					 aday = '19' + idCardNo.substring( 6, 12 );
					 if (!_this.formateDateCN(aday, IsYear)) {
			            idCardInfo.age = 0;
			            idCardInfo.gender = '';
			            idCardInfo.birthday = '';
                        idCardInfo.bl = false;
					 	return idCardInfo;
					 }
					idCardInfo.birthday = _this.formateDateCN(aday, IsYear);
					if ( parseInt( idCardNo.charAt( 14 ) ) % 2 == 0 ) {
						idCardInfo.gender = '女';
					} else {
						idCardInfo.gender = '男';
					}
				} else if (idCardNo.length == 18) {
					aday = idCardNo.substring(6, 14);
					if (!_this.formateDateCN(aday, IsYear)) {
						idCardInfo.age = 0;
						idCardInfo.gender = '';
						idCardInfo.birthday = '';
                        idCardInfo.bl = false;
						return idCardInfo;
					}
					idCardInfo.birthday = _this.formateDateCN(aday, IsYear);
					if (parseInt(idCardNo.charAt( 16 )) % 2 == 0 ) {
						idCardInfo.gender = '女';
					} else {
						idCardInfo.gender = '男';
					}
				}
				
				//计算年龄
				let birthDate = new Date(_this.formateDateCN( aday ));
				let nowDateTime = new Date();
				let age = nowDateTime.getFullYear() - birthDate.getFullYear();
				//再考虑月、天的因素;.getMonth()获取的是从0开始的，这里进行比较，不需要加1
				if (nowDateTime.getMonth() < birthDate.getMonth() || (nowDateTime.getMonth() == birthDate.getMonth() && nowDateTime.getDate() < birthDate.getDate())) {
					age--;
				}
				idCardInfo.age = age;
					
				return idCardInfo;
			},
			//  初始化数据方法
			getDataInit(obj) {
				let data = {
					vehicleInfo:[
						{
							title:'车牌号',
							value:(obj['VehiclePlateNo']?obj['VehiclePlateNo']:''),
							isTitleColon:true,
							type:"input",
							name:'VehiclePlateNo',
							width:30,
							inputStyle:{	//input输入框样式
								placeholderText:"必填",		//默认显示内容
								type:"text",	//input输入框拉起键盘类型：text（拼音键盘） , number（数字键盘） , idcard（身份证雅正键盘）
							},
							rStyle:{type:""}
						},
						{
							title:'VIN码',
							value:(obj['VehicleVIN']?obj['VehicleVIN']:''),
							isTitleColon:true,
							type:"input",
							name:'VehicleVIN',
							width:30,
							inputStyle:{	//input输入框样式
								placeholderText:"必填",		//默认显示内容
								maxlength:17,
								type:"text",	//input输入框拉起键盘类型：text（拼音键盘） , number（数字键盘） , idcard（身份证雅正键盘）
							},
							rStyle:{type:""}	
						},
						{
							title:'发动机号',
							value:(obj['VehicleEngineNo']?obj['VehicleEngineNo']:''),
							isTitleColon:true,
							type:"input",
							name:'VehicleEngineNo',
							width:30,
							inputStyle:{	//input输入框样式
								placeholderText:"必填",		//默认显示内容
								type:"text",	//input输入框拉起键盘类型：text（拼音键盘） , number（数字键盘） , idcard（身份证雅正键盘）
							},
							rStyle:{type:""}	
						},
						{
							title:'初登日期',
							value:(obj['VehicleRegistryDate']?obj['VehicleRegistryDate']:''),
							isTitleColon:true,
							type:"picker",
							name:'VehicleRegistryDate',
							mode:'date',
							width:30,
							rStyle:{type:""}
						},
						{
							title:'保险到期日期',
							value:(obj['InsureEndDate']?obj['InsureEndDate']:!obj['VehicleRegistryDate']?'':_this.getVehicleRegistryDate(obj['VehicleRegistryDate'])),
							isTitleColon:true,
							type:"picker",
							name:'InsureEndDate',
							mode:'date',
							width:30,
							rStyle:{type:""}
						},
						{
							title:'厂牌',
							value:(obj['VehicleMaker']?obj['VehicleMaker']:''),
							isTitleColon:true,
							type:"input",
							name:'VehicleMaker',
							width:30,
							inputStyle:{	//input输入框样式
								placeholderText:"必填",		//默认显示内容
								type:"text",	//input输入框拉起键盘类型：text（拼音键盘） , number（数字键盘） , idcard（身份证雅正键盘）
							},
							rStyle:{type:""}
						},
						{
							title:'车型',
							value:(obj['VehicldeModelFullName']?obj['VehicldeModelFullName']:''),
							SN:(obj['VehicleCarModelLibId']?obj['VehicleCarModelLibId']:''),
							isTitleColon:true,
							isInputClick:true,
							type:"input",
							name:'VehicldeModelFullName',
							SNName:'VehicleCarModelLibId',
							width:30,
							inputStyle:{	//input输入框样式
								placeholderText:"必填",		//默认显示内容
								type:"text",	//input输入框拉起键盘类型：text（拼音键盘） , number（数字键盘） , idcard（身份证雅正键盘）
							},
							rStyle:{type:""}
						},
						{
							title:'车型编码',
							value:(obj['VehicleTypeCode']?obj['VehicleTypeCode']:''),
							isTitleColon:true,
							type:"input",
							name:'VehicleTypeCode',
							width:30,
							inputStyle:{	//input输入框样式
								placeholderText:"必填",		//默认显示内容
								type:"text",	//input输入框拉起键盘类型：text（拼音键盘） , number（数字键盘） , idcard（身份证雅正键盘）
							},
							rStyle:{type:""}
						},
                        {
                        	title:'排量',
                        	value:(obj['VehicleDisplacement']?obj['VehicleDisplacement']:''),
                        	isTitleColon:true,
                        	type:"input",
                        	name:'VehicleDisplacement',
                        	width:30,
                        	inputStyle:{	//input输入框样式
                                placeholderText:"必填",		//默认显示内容
                        		type:"text",	//input输入框拉起键盘类型：text（拼音键盘） , number（数字键盘） , idcard（身份证雅正键盘）
                        	},
                        	rStyle:{type:""}
                        },
					],
					vehicleInfoMore:[
						{
							title:'行驶证发证日期',
							value:(obj['VehicleLicenseDate']?obj['VehicleLicenseDate']:obj['VehicleRegistryDate']),
							isTitleColon:true,
							type:"picker",
							name:'VehicleLicenseDate',
							mode:'date',
							width:30,
							rStyle:{type:""}
						},
						{
							title:'座位数',
							value:(obj['VehicleSeatCount']?obj['VehicleSeatCount']:0),
							isTitleColon:true,
							type:"input",
							name:'VehicleSeatCount',
							width:30,
							inputStyle:{	//input输入框样式
								type:"number",	//input输入框拉起键盘类型：text（拼音键盘） , number（数字键盘） , idcard（身份证雅正键盘）
							},
							rStyle:{type:""}
						},
						{
							title:'配置',
							value:(obj['VehicleConfiguration']?obj['VehicleConfiguration']:''),
							isTitleColon:true,
							type:"input",
							name:'VehicleConfiguration',
							width:30,
							inputStyle:{	//input输入框样式
								type:"text",	//input输入框拉起键盘类型：text（拼音键盘） , number（数字键盘） , idcard（身份证雅正键盘）
							},
							rStyle:{type:""}
						},
						{
							title:'进口/国产',
							value:(!obj['VehicleMakeCountry']?'':obj['VehicleMakeCountry']=='进口'?0:1),
							isTitleColon:true,
							type:"picker",
							name:'VehicleMakeCountry',
							mode:'selector',
							width:30,
							picker:['进口','国产'],
							rStyle:{type:""}
						},
						{
							title:'使用性质',
							value:(!obj['VehicleBizType']?'':obj['VehicleBizType']=='非营运'?0:1),
							isTitleColon:true,
							type:"picker",
							name:'VehicleBizType',
							mode:'selector',
							width:30,
							picker:['非营运','营运'],
							rStyle:{type:""}
						},
						{
							title:'车牌地区',
							value:(obj['VehiclePlateCity']?obj['VehiclePlateCity']:''),
							titleColor:"#999999",		//标题颜色
							isTitleColon:true,
							isDisabled:true,
							name:'VehiclePlateCity',
							type:"input",
							width:30,
							inputStyle:{	//input输入框样式
								type:"text",	//input输入框拉起键盘类型：text（拼音键盘） , number（数字键盘） , idcard（身份证雅正键盘）
							},
							rStyle:{type:""}
						},
						{
							title:'公里数',
							value:(obj['VehicleKilometer']?obj['VehicleKilometer']:0),
							isTitleColon:true,
							type:"input",
							name:'VehicleKilometer',
							width:30,
							inputStyle:{	//input输入框样式
								type:"number",	//input输入框拉起键盘类型：text（拼音键盘） , number（数字键盘） , idcard（身份证雅正键盘）
							},
							rStyle:{type:""}
						},
						{
							title:'购车付款方式',
							value:(!obj['VehiclePayType']?'':obj['VehiclePayType']=='全款'?0:1),
							isTitleColon:true,
							type:"picker",
							name:'VehiclePayType',
							mode:'selector',
							width:30,
							picker:['全款','按揭'],
							rStyle:{type:""}
						},
						{
							title:'车辆备注',
							value:(obj['VehicleComments']?obj['VehicleComments']:''),
							isTitleColon:true,
							isTCenter:true,
							type:"textarea",
							name:'VehicleComments',
							width:30,
							inputStyle:{	//input输入框样式
								placeholderText:"",		//默认显示内容
								isAutoHeight:true,
								type:"text",	//input输入框拉起键盘类型：text（拼音键盘） , number（数字键盘） , idcard（身份证雅正键盘）
							},
							rStyle:{type:""}
						},
						{
							title:'是否精典新车',
							value:'',
							isTitleColon:true,
							type:"checkbox",
							name:'VehicleIsShopNewCar',
							width:30,
							optionBoxs:[	//选项框 样式
								{
									text:"",	//显示值
									value:"是否精典新车",	//隐藏值
									boxSize:0.5,	// 范围：0.5~1
									isBoxCheck: obj['VehicleIsShopNewCar'],	//是否选中
									isBoxDisabled:false,		//是否禁止
									boxColor:"#FFFFFF"	//选中后样式颜色
								}
							],
							rStyle:{type:""}
						},
					],
					customerInfo:[
						{
							title:'客户姓名',
							value:(obj['CustomerName']?obj['CustomerName']:''),
							isTitleColon:true,
							type:"input",
							name:'CustomerName',
							width:30,
							inputStyle:{	//input输入框样式
								placeholderText:"必填",		//默认显示内容
								type:"text",	//input输入框拉起键盘类型：text（拼音键盘） , number（数字键盘） , idcard（身份证雅正键盘）
							},
							rStyle:{type:""}
						},
						{
							title:'证件类型',
							value:'0',
							isTitleColon:true,
							type:"picker",
							name:'CustomerCardType',
							mode:'selector',
							width:30,
							picker:this.$ZcPublic.Constant.CAR_TYPE,
							rStyle:{type:""}
						},
						{
							title:'证件号',
							value:(!obj?'':obj['CustomerCardNo']?obj['CustomerCardNo']:''),
						    number: (!obj?0:obj['CustomerCardNo']?obj['CustomerCardNo'].length:0),
							isTitleColon:true,
							type:"input",
							name:'CustomerCardNo',
						    isChangeValue:true,
							width:30,
							inputStyle:{	//input输入框样式
								placeholderText:"",		//默认显示内容
								type:"idcard",	//input输入框拉起键盘类型：text（拼音键盘） , number（数字键盘） , idcard（身份证雅正键盘）
							},
							rStyle:{type:""}
						},
						{
							title:'联系电话',
							value:(obj['CustomerTelephone']?obj['CustomerTelephone']:''),
							isTitleColon:true,
							type:"input",
							name:'CustomerTelephone',
							width:30,
							inputStyle:{	//input输入框样式
								placeholderText:"必填",		//默认显示内容
								maxlength:11,
								type:"number",	//input输入框拉起键盘类型：text（拼音键盘） , number（数字键盘） , idcard（身份证雅正键盘）
							},
							rStyle:{type:""}
						}
					],
					customerInfoMore:[
						{
							title:'其他联系方式',
							value:(!obj?'':obj['CustomerOtherContacts']?obj['CustomerOtherContacts']:''),
							isTitleColon:true,
							type:"input",
							name:'CustomerOtherContacts',
							width:30,
							inputStyle:{	//input输入框样式
								type:"text",	//input输入框拉起键盘类型：text（拼音键盘） , number（数字键盘） , idcard（身份证雅正键盘）
							},
							rStyle:{type:""}
						},
						{
							title:'生日',
							value:(obj['CustomerBirthDate']?obj['CustomerBirthDate']:(obj['CustomerCardType'] !='身份证')?'':!obj['CustomerCardNo']?'':_this.getIdCardInfo(obj['CustomerCardNo']).birthday),
							isTitleColon:true,
							type:"picker",
							name:'CustomerBirthDate',
							mode:'date',
							width:30,
							rStyle:{type:""}
						},
						{
							title:'性别',
							value:(!obj['CustomerSex']?((obj['CustomerCardType'] !='身份证')?0:!obj['CustomerCardNo']?0:_this.getIdCardInfo(obj['CustomerCardNo']).gender=='男'?0:1):obj['CustomerSex']=='男'?0:1),
							isTitleColon:true,
							type:"picker",
							name:'CustomerSex',
							mode:'selector',
							width:30,
							picker:['男','女'],
							rStyle:{type:""}
						},
						{
							title:'年龄',
							value:(obj['CustomerAge']?obj['CustomerAge']:(obj['CustomerCardType'] !='身份证')?'':!obj['CustomerCardNo']?'':_this.getIdCardInfo(obj['CustomerCardNo']).age),
							isTitleColon:true,
							type:"input",
							name:'CustomerAge',
							width:30,
							inputStyle:{	//input输入框样式
								placeholderText:"",		//默认显示内容
								maxlength:3,
								type:"number",	//input输入框拉起键盘类型：text（拼音键盘） , number（数字键盘） , idcard（身份证雅正键盘）
							},
							rStyle:{type:""}
						},
						{
							title:'区域',
							value:(obj['CusotmerCity']?obj['CusotmerCity']:''),
							SN:(obj['CustomerCitySN']?obj['CustomerCitySN']:''),
							isTitleColon:true,
							type:"input",
							name:'CusotmerCity',
							SNName:'CustomerCitySN',
							isInputClick:true,
							width:30,
							rStyle:{type:""}
						},
						{
							title:'详细地址',
							value:(obj['CustomerAddress']?obj['CustomerAddress']:''),
							isTitleColon:true,
							type:"input",
							name:'CustomerAddress',
							width:30,
							inputStyle:{	//input输入框样式
								placeholderText:"",		//默认显示内容
								type:"text",	//input输入框拉起键盘类型：text（拼音键盘） , number（数字键盘） , idcard（身份证雅正键盘）
							},
							rStyle:{type:""}
						},
						{
							title:'证件有效期',
							value:(obj['CustomerCardValidDate']?obj['CustomerCardValidDate']:''),
							isTitleColon:true,
							type:"picker",
							name:'CustomerCardValidDate',
							mode:'date',
							width:30,
							rStyle:{type:""}
						},
						{
							title:'客户免打扰',
							value:'',
							isTitleColon:true,
							type:"checkbox",
							name:'CustomerIsNoBother',
							width:30,
							optionBoxs:[	//选项框 样式
								{
									text:"",	//显示值
									value:"客户免打扰",	//隐藏值
									boxSize:0.5,	// 范围：0.5~1
									isBoxCheck: obj['CustomerIsNoBother'],	//是否选中
									isBoxDisabled:false,		//是否禁止
									boxColor:"#FFFFFF"	//选中后样式颜色
								}
							],
							rStyle:{type:""}
						}
					],
					customerLebal:[],
					customerLebalInfo:[],
					policyInfo:[
						{
							title:'保险有效期',
							value:(obj['InsureStartDate']?obj['InsureStartDate']:'')+'~'+ (obj['InsureEndDate']?obj['InsureEndDate']:''),
							isTitleColon:true,
							titleColor:"#999999",		//标题颜色
							name:'InsureStartDate',
							type:"input",
                            mode:"multTime",
							isDisabled:true,
							width:30,
							inputStyle:{	//input输入框样式
								placeholderText:"",		//默认显示内容
								type:"text",	//input输入框拉起键盘类型：text（拼音键盘） , number（数字键盘） , idcard（身份证雅正键盘）
							},
							rStyle:{type:""}
						},
						{
							title:'保险公司',
							value:(obj['InsureCompany']?obj['InsureCompany']:''),
							isTitleColon:true,
							isDisabled:true,
							titleColor:"#999999",		//标题颜色
							name:'InsureCompanyName',
							type:"input",
							width:30,
							inputStyle:{	//input输入框样式
								placeholderText:"",		//默认显示内容
								type:"text",	//input输入框拉起键盘类型：text（拼音键盘） , number（数字键盘） , idcard（身份证雅正键盘）
							},
							rStyle:{type:""}
						},
						{
							title:'保费',
							value:(obj['InsureMoney']?obj['InsureMoney']:0),
							isTitleColon:true,
							isDisabled:true,
							titleColor:"#999999",		//标题颜色
							name:'InsureMoney',
							type:"input",
							width:30,
							inputStyle:{	//input输入框样式
								placeholderText:"",		//默认显示内容
								type:"text",	//input输入框拉起键盘类型：text（拼音键盘） , number（数字键盘） , idcard（身份证雅正键盘）
							},
							rStyle:{type:""}
						}
					],
					visitInfo:[
						{
							title:'跟进状态',
							value:(!obj?'':!obj['LastTraceTask']?'':obj['LastTraceTask'].TaskStatus?obj['LastTraceTask'].TaskStatus:''),
							isTitleColon:true,
							isDisabled:true,
							titleColor:"#999999",		//标题颜色
							type:"input",
							name:'LastTraceStatus',
							width:30,
							inputStyle:{	//input输入框样式
								placeholderText:"",		//默认显示内容
								type:"text",	//input输入框拉起键盘类型：text（拼音键盘） , number（数字键盘） , idcard（身份证雅正键盘）
							},
							rStyle:{type:""}
						},
						{
							title:'回访类型',
							value:(!obj?'':!obj['LastTraceTask']?'':obj['LastTraceTask'].TraceResult?obj['LastTraceTask'].TraceResult:''),
							isTitleColon:true,
							isDisabled:true,
							titleColor:"#999999",		//标题颜色
							type:"input",
							name:'LastTraceType',
							width:30,
							inputStyle:{	//input输入框样式
								placeholderText:"",		//默认显示内容
								type:"text",	//input输入框拉起键盘类型：text（拼音键盘） , number（数字键盘） , idcard（身份证雅正键盘）
							},
							rStyle:{type:""}
						},
						{
							title:'最近回访时间',
							value:(!obj?'':!obj['LastTraceTask']?'':obj['LastTraceTask'].TraceDate?obj['LastTraceTask'].TraceDate:''),
							isTitleColon:true,
							type:"input",
							name:'LastTraceDate',
							isDisabled:true,
							titleColor:"#999999",		//标题颜色
							width:30,
							inputStyle:{	//input输入框样式
								placeholderText:"",		//默认显示内容
								type:"text",	//input输入框拉起键盘类型：text（拼音键盘） , number（数字键盘） , idcard（身份证雅正键盘）
							},
							rStyle:{type:""}
						}
					],
					Files:[
						{
							id:1,
							bgImag: _this.imgPath+'UniImages/car2.png',
							name:'行驶证正本',
							images:[],
							imgInfos:[]
						},
						{
							id:2,
							bgImag: _this.imgPath+'UniImages/car1.png',
							name:'行驶证副本',
							images:[],
							imgInfos:[]
						},
						{
							id:3,
							bgImag: _this.imgPath+'UniImages/car4.png',
							name:'驾驶证正本',
							images:[],
							imgInfos:[]
						},
						{
							id:4,
							bgImag: _this.imgPath+'UniImages/car3.png',
							name:'驾驶证副本',
							images:[],
							imgInfos:[]
						},
						{
							id:5,
							bgImag: _this.imgPath+'UniImages/car6.png',
							name:'身份证正面',
							images:[],
							imgInfos:[]
						},
						{
							id:6,
							bgImag: _this.imgPath+'UniImages/car5.png',
							name:'身份证反面',
							images:[],
							imgInfos:[]
						},
						{
							id:7,
							bgImag: _this.imgPath+'UniImages/car7.png',
							name:'车辆图片',
							images:[],
							imgInfos:[]
						}
					],
					img:{
						id:8,
						bgImag: _this.imgPath+'UniImages/car8.png',
						name:'其他',
						images:[],
						imgInfos:[]
					},
					//  以下是其他数据信息
					SN: obj['SN'],
					TS: obj['TS'],
					CustomerInfoSN: obj['CustomerInfoSN'],
                    IsMainSalesMan: !obj?false:obj['IsMainSalesMan'], 
                    IsVehicleOwner:true,
                    VehicleOwnerName: !obj?'':obj['VehicleOwnerName']?obj['VehicleOwnerName']:'',
                    VehicleOwnerTelephone: !obj?'':obj['VehicleOwnerTelephone']?obj['VehicleOwnerTelephone']:'',
                    VehicleOwnerType: !obj?'':obj['VehicleOwnerType']?obj['VehicleOwnerType']:'',
                    VehicleOwnerCity: !obj?'':obj['VehicleOwnerCity']?obj['VehicleOwnerCity']:'',
                    VehicleOwnerCitySN: !obj?'':obj['VehicleOwnerCitySN']?obj['VehicleOwnerCitySN']:'',
                    VehicleOwnerAddress: !obj?'':obj['VehicleOwnerAddress']?obj['VehicleOwnerAddress']:'',
                    VehicleOwnerCardNo: !obj?'':obj['VehicleOwnerCardNo']?obj['VehicleOwnerCardNo']:'',
                    VehicleOwnerCardType: !obj?'':obj['VehicleOwnerCardType']?obj['VehicleOwnerCardType']:this.$ZcPublic.Constant.CAR_TYPE[0],
					VehicleType: (!obj?'':obj['VehicleType']?obj['VehicleType']:''),	//	车型
					VehicleMakeName: (!obj?'':obj['VehicleMakeName']?obj['VehicleMakeName']:''),	//	车型品牌
					VehicleSerialName: (!obj?'':obj['VehicleSerialName']?obj['VehicleSerialName']:''),	//	名称
					VehicleMakeYear: (!obj?'':obj['VehicleMakeYear']?obj['VehicleMakeYear']:''),	//	年款
					VehicleEmission: obj['VehicleEmission'],	//	排放标准
					VehiclePrice: obj['VehiclePrice'],//	新车购置价
					VehicleIsNewCar: obj['VehicleIsNewCar'],
                    VehiclePlateNoIsWrong:obj['VehiclePlateNoIsWrong'], // 是否 过户待定
					VehicleEnergyName: obj['VehicleEnergyName'],//	能源名称
					VehicleEnergyCode: obj['VehicleEnergyCode']	//	能源编码
				}
				
                if (!obj?false:obj['VehicleOwnerName']) {
                    data.IsVehicleOwner = false;
                }
                
				//  初始化标签
				if (obj.Labels !== null && obj.Labels.length > 0) {
					data.customerLebalInfo = obj.Labels;
					
					for (let i = 0; i < obj.Labels.length; i++) {
						if (obj.Labels[i].childs !== null && obj.Labels[i].childs.length > 0) {
							for (let j = 0; j < obj.Labels[i].childs.length; j++) {
								let item = {
									title:obj.Labels[i].childs[j].Name,
									Code:obj.Labels[i].childs[j].Code,
									isShow:false,
									value:'',
									isDisabled:false,
									row:48,
									type:'audio',
									info:obj.Labels[i].childs[j],
									actives:[],
									aValue:'',
									list:obj.Labels[i].childs[j].childs
								}
								if (obj.Labels[i].childs[j].sModel === '单选') {
									item.type = 'audio';
								}else if (obj.Labels[i].childs[j].sModel === '多选') {
									item.type = 'checkbox';
								}
								if (obj.Labels[i].childs[j].OnlyWrite) {
									item.isDisabled = true;
								}
								for (var s = 0; s < obj.Labels[i].childs[j].childs.length; s++) {
									if (obj.Labels[i].childs[j].childs[s].isS) {
										item.actives.push(s);
									}
								}
								for (let a = 0; a < item.actives.length; a++) {
									if (a === 0) {
										item.aValue = item.list[item.actives[a]].Name;
									}else {
										item.aValue = item.aValue +' , '+ item.list[item.actives[a]].Name;
									}
								}
								
								data.customerLebal.push(item);
								
								//  判断是否存在 二级标签
								for (var k = 0; k < obj.Labels[i].childs[j].childs.length; k++) {
									
									if (obj.Labels[i].childs[j].childs[k].oS !== null && obj.Labels[i].childs[j].childs[k].isS && obj.Labels[i].childs[j].childs[k].oS.length > 0) {
										
										for (var m = 0; m < obj.Labels[i].childs[j].childs[k].oS.length; m++) {
											let item1 = {
												title:obj.Labels[i].childs[j].childs[k].oS[m].Name,
												Code:obj.Labels[i].childs[j].childs[k].oS[m].Code,
												isShow:false,
												value:obj.Labels[i].childs[j].childs[k].Code,
												isDisabled:false,
												row:48,
												type:'audio',
												info:obj.Labels[i].childs[j].childs[k].oS[m],
												actives:[],
												aValue:'',
												list:obj.Labels[i].childs[j].childs[k].oS[m].childs
											}
											if (obj.Labels[i].childs[j].childs[k].oS[m].sModel === '单选') {
												item1.type = 'audio';
											}else if (obj.Labels[i].childs[j].childs[k].oS[m].sModel === '多选') {
												item1.type = 'checkbox';
											}
											if (obj.Labels[i].childs[j].childs[k].oS[m].OnlyWrite) {
												item1.isDisabled = true;
											}
											for (var t = 0; t < obj.Labels[i].childs[j].childs[k].oS[m].childs.length; t++) {
												if (obj.Labels[i].childs[j].childs[k].oS[m].childs[t].isS) {
													item1.actives.push(t);
												}
											}
											for (let a = 0; a < item1.actives.length; a++) {
												if (a === 0) {
													item1.aValue = item1.list[item1.actives[a]].Name;
												}else {
													item1.aValue = item1.aValue +' , '+ item1.list[item1.actives[a]].Name;
												}
											}
											
											data.customerLebal.push(item1);
										}
										
									}
								}
							}
						}
					}
				}
				
				//  附件 数据初始化
				if (obj.Files !== null && obj.Files.length > 0) {
					for (let i = 0; i < obj.Files.length; i++) {
						if (obj.Files[i].FileTitle === '行驶证正本') {
							data.Files[0].images.push({url:obj.Files[i].LUrl});
							data.Files[0].imgInfos.push(obj.Files[i]);
						}else if (obj.Files[i].FileTitle === '行驶证副本') {
							data.Files[1].images.push({url:obj.Files[i].LUrl});
							data.Files[1].imgInfos.push(obj.Files[i]);
						}else if (obj.Files[i].FileTitle === '驾驶证正本') {
							data.Files[2].images.push({url:obj.Files[i].LUrl});
							data.Files[2].imgInfos.push(obj.Files[i]);
						}else if (obj.Files[i].FileTitle === '驾驶证副本') {
							data.Files[3].images.push({url:obj.Files[i].LUrl});
							data.Files[3].imgInfos.push(obj.Files[i]);
						}else if (obj.Files[i].FileTitle === '身份证正面') {
							data.Files[4].images.push({url:obj.Files[i].LUrl});
							data.Files[4].imgInfos.push(obj.Files[i]);
						}else if (obj.Files[i].FileTitle === '身份证反面') {
							data.Files[5].images.push({url:obj.Files[i].LUrl});
							data.Files[5].imgInfos.push(obj.Files[i]);
						}else if (obj.Files[i].FileTitle === '车辆图片') {
							data.Files[6].images.push({url:obj.Files[i].LUrl});
							data.Files[6].imgInfos.push(obj.Files[i]);
						}else if (obj.Files[i].FileTitle === '其他') {
							data.img.images.push({url:obj.Files[i].LUrl});
							data.img.imgInfos.push(obj.Files[i]);
						}
					}
				}
				return data;
			}
			
			
		}
	}
</script>

<style>
	.card_item_name>view{line-height: 1!important;}
	.card_item_text>input{text-align: right;}
	.card_item_text .uni-input{text-align: right;}
	.card_item_text>view{font-weight: bold;}
	.card_item_text>textarea{height: 80upx;}
	.zcModel-title{padding: 20upx;display: flex;color: #999999;}
	.moreBox > view:first-child{transition: max-height 1s ease;max-height: 0;overflow: hidden;}
	.moreBox > view:last-child> view{padding: 10upx 0;}
	.zcDisabled input[disabled]{color: #999999!important;}
	picker[disabled] view{color: #999999!important;}
	zc-up-photo,.zcUpPhoto_name{flex: 0 0 48%;}
	.zcCustomPhoto{flex-wrap: wrap;}
	.zcCustomPhoto .zc_addImg{margin-left: -84upx;margin-top: -84upx;}
	/* 新增样式 */
	/* .carInfo .card_item:last-child{border: none;} */
	.icon-Order-Details-SeeMore{transform: rotate(0deg);transition: 0.5s;}
	.icon-Order-Details-SeeMore:after{
		content: "\e6d6";
	}
	.card_item_text input,.card_item_text .uni-input,.card_item_text textarea{height: 50upx;min-height: 50upx;}
	.carMore{max-height: 1450upx!important;}
	.customerMore{max-height: 800upx!important;}
	checkbox .wx-checkbox-input.wx-checkbox-input-checked{background-color: #3CA4FA!important;}
	
	/* 新增样式  END */
	.card_item .card_item_text>picker .uni-input{position: relative;padding: 0; z-index: 6;padding-right: 50upx;}
	.card_item .card_item_text>picker .uni-input:after{
		font-family: "iconfont" !important;
		font-size: 28upx;
		font-style: normal;
		font-weight: bold;
		position: absolute;
		-webkit-font-smoothing: antialiased;
		-moz-osx-font-smoothing: grayscale;
		content: '\e600';
		top: 0;
		right: 0upx;
		margin-top: 0upx;
	}
	
	/* 标签 */
	.popup_content{
		display: flex;
		flex-wrap: wrap;
		padding: 10upx 20upx;
		flex-direction: row;
		background-color: #FFFFFF;
	}
	.popup_item{
		display: flex;
		float: left;
		flex-direction: row;
		justify-content: center;
		align-items: center;
		flex-shrink: 0;
		border: 1px solid #999999;
		color: #999999;
		margin: 10upx 1%;
		height: 52upx;
		border-radius: 52upx;
		box-sizing: border-box;
	}
	.active{border-color: #26a6ff;color: #26a6ff;}
	/* ----END----- */
	
	.zcFooter-but{position: fixed;bottom: 0;left: 0;width: 100%;z-index: 10;background-color: #F4F5F6!important;}
	.zcFooter-but button:first-child{flex: 1;border: 2upx solid #3CA4FA;color: #3CA4FA;border-radius: 0;font-size: 32upx;}
	.zcFooter-but button:last-child{flex: 1;border: 2upx solid rgba(60, 164, 250, 1);background-color: rgba(60, 164, 250, 1);color: #FFFFFF;border-radius: 0;font-size: 32upx;}
	.zcFooter-but .button-hover:last-child{color: rgba(250, 250, 250, 0.6);background-color: rgba(60, 164, 250, 0.6)!important;flex: 1;}
	
</style>
